﻿<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="UCLHBiaoInfoQS.ascx.cs" Inherits="Web.Controls.UCLHBiaoInfoQS" %>
<%@ Register Assembly="DevExpress.Web.v15.2, Version=15.2.9.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" Namespace="DevExpress.Web" TagPrefix="dx" %>
<script type="text/javascript">
    //$(function () {

    //});
    function GetValue(type) {
        if (type == 'bh') {
            return UCLHUserInfo_hdCollection.Get("bh");
        }
        else {
            return "";
        }
    }
    function UCLHUserInfo_txtBHKeyPress() {
        if (event.keyCode == 13) {
            setTimeout(function () {

            }, 0);
            event.preventDefault ? event.preventDefault() : (event.returnValue = false);
            if (UCLHUserInfo_txtShuiBiaoBH.GetText() === '') {
                alert('请输入表编号。');
                if (typeof (UCLHUserInfo_txtBiaoHao) == "undefined" || typeof (UCLHUserInfo_txtBiaoHao) == undefined) {
                    UCLHUserInfo_txtBiaoHao.SetText("");
                }
                if (typeof (UCLHUserInfo_txtKouJing) == "undefined" || typeof (UCLHUserInfo_txtKouJing) == undefined) {
                    UCLHUserInfo_txtKouJing.SetText("");
                }
                UCLHUserInfo_txtYongHuH.SetText("");
                UCLHUserInfo_txtYongHuM.SetText("");
                UCLHUserInfo_txtJinBH.SetText("");
                UCLHUserInfo_txtLaoBH.SetText("");
                UCLHUserInfo_txtDiZhi.SetText("");
                UCLHUserInfo_txtShuiBiaoBH.Focus();
                return;
            }
            UCLHUserInfo_ASPxCallback1.PerformCallback("bh");
        }
    }
    function UCLHUserInfo_txtBH2KeyPress() {
        if (event.keyCode == 13) {
            setTimeout(function () {

            }, 0);
            event.preventDefault ? event.preventDefault() : (event.returnValue = false);
            if (UCLHUserInfo_txtTargetYongHuH.GetText() == '') {
                alert('请输入目标用户号。');
                UCLHUserInfo_txtTargetYongHuM.SetText("");
                UCLHUserInfo_txtTargetYongHuH.Focus();
                return;
            }
            UCLHUserInfo_ASPxCallback1.PerformCallback("bh2");
        }
    }
    function UCLHUserInfo_ASPxCallbackCommonComplete(rs) {
        var arr = rs.split('|');
        var type = arr[0];
        var state = arr[1];
        var specialIdentity = arr[2];
        var msg = arr[3].split('-');
        if (msg[0] == 'True') {
            alert(msg[1]);
        }
        UCLHUserInfo_hdCollection.Set("type", type);
        if (state == 'True') {
            if (type == "bh") {
                //将用户号传递给文件控件
                UCLHBtnBottom_hdCollection.Set("yonghuh", arr[6]);
                //加载信息
                //alert(UCLHUserInfo_txtBiaoHao);
                if (typeof (UCLHUserInfo_txtBiaoHao) != "undefined" && typeof (UCLHUserInfo_txtBiaoHao) != undefined) {
                    UCLHUserInfo_txtBiaoHao.SetText(arr[4]);
                }
                if (typeof (UCLHUserInfo_txtKouJing) != "undefined" && typeof (UCLHUserInfo_txtKouJing) != undefined) {
                    UCLHUserInfo_txtKouJing.SetText(arr[5]);
                }
                UCLHUserInfo_txtYongHuH.SetText(arr[6]);
                UCLHUserInfo_txtYongHuM.SetText(arr[7]);
                UCLHUserInfo_txtJinBH.SetText(arr[8]);
                if (typeof (UCLHUserInfo_txtLaoBH) != "undefined" && typeof (UCLHUserInfo_txtLaoBH) != undefined) {
                    UCLHUserInfo_txtLaoBH.SetText(arr[9]);
                }
                UCLHUserInfo_txtDiZhi.SetText(arr[10]);
                if (typeof (UCLHUserInfo_txtTargetYongHuH) == "undefined" || typeof (UCLHUserInfo_txtTargetYongHuH) == undefined) {
                    UCLHUserInfo_btnActPerform.onClick();
                }
            }
            else if (type == "bh2") {
                //加载信息
                UCLHUserInfo_txtTargetYongHuM.SetText(arr[4]);
                UCLHUserInfo_btnActPerform.onClick();
            }
        }
    }   

</script>
 <div style="display:none;">
                <dx:ASPxButton ID="btnActPerform" ClientInstanceName="UCLHUserInfo_btnActPerform" runat="server" Text="ASPxButton" OnClick="btnActPerform_Click"></dx:ASPxButton>
                    </div>
<dx:ASPxHiddenField ID="hdCollection" ClientInstanceName="UCLHUserInfo_hdCollection" runat="server"></dx:ASPxHiddenField>
<dx:ASPxCallback ID="ASPxCallback1" ClientInstanceName="UCLHUserInfo_ASPxCallback1" runat="server" OnCallback="ASPxCallback1_Callback" ClientSideEvents-CallbackComplete="function(s,e){UCLHUserInfo_ASPxCallbackCommonComplete(e.result);}"></dx:ASPxCallback>
<fieldset style="border: 1px solid  cornflowerblue;width:97%;margin:auto;">
    <legend><b>表信息</b></legend>
    <table style="width:70%;margin:auto;">
        <tr>
            <td align="right" style="width: 16%">登记文号：
            </td>
            <td style="width: 17%">
                <dx:ASPxTextBox ID="txtLaiHanBH" ReadOnly="true" runat="server" Width="100%" Text=""></dx:ASPxTextBox>
            </td>
            <td style="width: 16%" align="right"><%--许可证编号：--%></td>
            <td style="width: 18%">
                 <dx:ASPxTextBox ID="txtXuKeZH" ReadOnly="true" runat="server" Width="100%" Text="" Visible="false"></dx:ASPxTextBox>
            </td>
            <td style="width: 16%">                
            </td>
            <td style="width: 17%"></td>
        </tr>
        <tr>
            <td align="right" >水表编号：
            </td>
            <td>
                <dx:ASPxTextBox ID="txtShuiBiaoBH" ClientInstanceName="UCLHUserInfo_txtShuiBiaoBH" runat="server" Text="" Width="100%" ClientSideEvents-KeyPress="function(s,e){UCLHUserInfo_txtBHKeyPress();}"></dx:ASPxTextBox>
            </td>
            <td align="right" runat="server" id="dxs1">表号：
            </td>
            <td runat="server" id="dxs2">
                <dx:ASPxTextBox ID="txtBiaoHao" ClientInstanceName="UCLHUserInfo_txtBiaoHao" runat="server" Text="" Width="100%" ></dx:ASPxTextBox>
            </td>
            <td align="right" runat="server" id="dxs3">表口径：
            </td>
            <td runat="server" id="dxs4">
                <dx:ASPxTextBox ID="txtKouJing" ClientInstanceName="UCLHUserInfo_txtKouJing" runat="server" Text="" Width="100%" ></dx:ASPxTextBox>
            </td>
        </tr>
         <tr>
            <td align="right">用户号：
            </td>
            <td colspan="5">
                <dx:ASPxTextBox ID="txtYongHuH" ClientInstanceName="UCLHUserInfo_txtYongHuH" runat="server" Text="" Width="100%"></dx:ASPxTextBox>
            </td>             
        </tr>
        <tr>
            <td align="right">用户名：
            </td>
            <td colspan="5">
                <dx:ASPxTextBox ID="txtYongHuM" ClientInstanceName="UCLHUserInfo_txtYongHuM" runat="server" Text="" Width="99.5%"></dx:ASPxTextBox>
            </td>
        </tr>
        <tr>
            <td align="right" runat="server" id="tJinK">井编号：
            </td>
            <td>
                <dx:ASPxTextBox ID="txtJinBH" ClientInstanceName="UCLHUserInfo_txtJinBH" runat="server" Text="" Width="100%" ClientSideEvents-KeyPress="function(s,e){UCLHUserInfo_txtBHKeyPress();}"></dx:ASPxTextBox>
            </td>
            <td align="right" runat="server" id="tYuanJin1">原井编号：
            </td>
            <td runat="server" id="tYuanJin2">
                <dx:ASPxTextBox ID="txtLaoBH" ClientInstanceName="UCLHUserInfo_txtLaoBH" runat="server" Text="" Width="100%" ></dx:ASPxTextBox>
            </td>
            <td></td>
            <td></td>
        </tr>
        <tr>
            <td align="right">取水地址：
            </td>
            <td colspan="5">
                <dx:ASPxTextBox ID="txtDiZhi" ClientInstanceName="UCLHUserInfo_txtDiZhi" runat="server" Text="" Width="100%"></dx:ASPxTextBox>
            </td>
        </tr>      
        <tr id="trTarget1" runat="server">
            <td align="right">目标用户号：
            </td>
            <td colspan="3">
                <dx:ASPxTextBox ID="txtTargetYongHuH" ClientInstanceName="UCLHUserInfo_txtTargetYongHuH" runat="server" Text="" Width="100%" ClientSideEvents-KeyPress="function(s,e){UCLHUserInfo_txtBH2KeyPress();}"></dx:ASPxTextBox>
            </td>
        </tr>
        <tr id="trTarget2" runat="server">
            <td align="right">目标用户名：
            </td>
            <td colspan="3">
                <dx:ASPxTextBox ID="txtTargetYongHuM" ClientInstanceName="UCLHUserInfo_txtTargetYongHuM" runat="server" Text="" Width="99.5%"></dx:ASPxTextBox>
            </td>
        </tr> 
        <tr runat="server" id="trYHDZ">
            <td align="right">用户地址：
            </td>
            <td colspan="5">
                <dx:ASPxTextBox ID="txtYongHuDZ" ClientInstanceName="UCLHUserInfo_txtYongHuDZ" runat="server" Text="" Width="99.5%"></dx:ASPxTextBox>
            </td>
        </tr>
    </table>
</fieldset>
